home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / comms / www / ibrowsescripts / demo next >
Text File  |  1999-04-19  |  3KB  |  100 lines

  1. /* Demo 
  2.     Made by Sören Forsberg : sorenf@hem1.passagen.se
  3.   
  4. */
  5.  
  6. OPTIONS RESULTS
  7. OPTIONS FAILAT 15
  8. call addlib('rexxreqtools.library',0,-30)
  9. lib= show('Libs',"rexxreqtools.library")
  10. NL='0a'x        /* newline */
  11. ib=0 ; mi=0
  12.     open('ibstart','CON:60/100/350/80/IBStart/cds')
  13.  
  14. /* Finds out where the scripts are stached */
  15. ADDRESS 'COMMAND' 'cd >T:progdir'
  16. ok=open(progdirfile,'T:progdir','R')
  17. progdir=readln(progdirfile)
  18. close(progdirfile)
  19.  
  20. /* gets the assignlist to avoid "Cant find Volume xxx:" */
  21. ADDRESS 'COMMAND' 'assign >T:assignlist dirs'
  22. ok=open(assignfile,'T:assignlist','R')
  23. alist=readch(assignfile,60000)
  24. close(configfile)
  25. alist=UPPER(alist)
  26. IF POS(NL||'IBROWSE',alist)~=0 THEN ib=1
  27. IF POS(NL||'MIAMI',alist)~=0 THEN mi=1
  28. IF ib THEN DO
  29.     start=POS(NL||'IBROWSE',alist)+1
  30.     end=POS(NL,alist,start)
  31.     line=SUBSTR(alist,start,end-start)
  32.     oldpath=WORD(line,2)
  33.     call writeln 'ibstart','IBrowse assign found. Skipped that part'
  34. END
  35. IF mi THEN call writeln 'ibstart','Miami   assign found. Skipped that part'
  36.     
  37.  fonttag         = "rt_font=" || 'topaz' || "/" || 8
  38.  title        ='IBS-Demo sorenf@hem1.passagen.se 1998'
  39.  what_but        ='_Run Demo|_Install|Cancel'
  40.  tags        ='rt_pubscrname=IBROWSESCREEN'  /* Change here the name of the screen IBROWSE runs */
  41.  noconfig_txt    ="If you haven't run the installer "||NL||'NOW would be a good idea'||NL||'Select Option'
  42.  
  43.  
  44. IF ~ib THEN DO 
  45.     name='IBrowse'
  46.     check='IBrowse.prefs'
  47.     CALL MAKEASSIGN
  48. END
  49.     
  50. IF ~mi THEN DO
  51.     name='Miami'
  52.     check='miami.default'
  53.     CALL MAKEASSIGN
  54. END
  55. call writeln 'ibstart','Rerouting assigns'
  56. ADDRESS 'COMMAND'
  57. 'assign ibrowse: remove'
  58. 'assign ibrowse: 'progdir
  59. 'assign ibrowse: 'oldpath ' add'
  60.  
  61.     IF SHOW('Ports','IBROWSE') THEN DO
  62.         ADDRESS 'IBROWSE' 'QUIT'
  63.         call writeln 'ibstart','Restarting IBrowse'
  64.         ADDRESS 'COMMAND' 'wait 5'
  65.     END
  66. ADDRESS 'COMMAND'
  67. 'IBrowse:Ibrowse CONFIGDIR IBrowse:'
  68. call writeln 'ibstart','Restoring assigns.'
  69. 'assign ibrowse: remove'
  70. 'assign ibrowse: 'oldpath
  71.  
  72. 'wait 5'
  73. EXIT
  74.  
  75. MAKEASSIGN:
  76.     call writeln 'ibstart','Could not find a '|| name ||'  assign!!!'
  77.     call writeln 'ibstart','Please enter the path to the '|| name ||'  directory'
  78.     call writeln 'ibstart','(Ex: "SYS:Surf/'|| name ||'" )'
  79.     IF name~='IBrowse' THEN call writeln 'ibstart','("Enter" / "Cancel" to skip this part. )'
  80.     call writeln 'ibstart',''
  81.     DO FOREVER
  82.         IF lib=0 THEN path=readln('ibstart')
  83.         IF lib=1 THEN path = rtfilerequest('SYS:', , "Pick "|| name ||"  directory",,"rtfi_flags = freqf_nofiles")
  84.  
  85.         IF path='' & name~='IBrowse' THEN BREAK
  86.         IF RIGHT(path,1)='/' THEN path=LEFT(path,(LENGTH(path)-1))
  87.         all=path||'/'|| check
  88.         If exists(all) then break
  89.         call writeln 'ibstart','Could not find '|| check ||'  in'
  90.         call writeln 'ibstart',path
  91.         call writeln 'ibstart','Please enter the path to the ' name ' directory'
  92.     END
  93.  
  94.     IF path~='' & name~='IBrowse' THEN DO
  95.         ADDRESS 'COMMAND'
  96.         'assign 'name':' path 
  97.     END
  98.     IF path~='' & name='IBrowse' THEN oldpath=path
  99.  
  100. RETURN